home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / lib / python2.6 / locale.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-11-11  |  47KB  |  1,644 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. """ Locale support.
  5.  
  6.     The module provides low-level access to the C lib's locale APIs
  7.     and adds high level number formatting APIs as well as a locale
  8.     aliasing engine to complement these.
  9.  
  10.     The aliasing engine includes support for many commonly used locale
  11.     names and maps them to values suitable for passing to the C lib's
  12.     setlocale() function. It also includes default encodings for all
  13.     supported locale names.
  14.  
  15. """
  16. import sys
  17. import encodings
  18. import encodings.aliases as encodings
  19. import functools
  20. __all__ = [
  21.     'getlocale',
  22.     'getdefaultlocale',
  23.     'getpreferredencoding',
  24.     'Error',
  25.     'setlocale',
  26.     'resetlocale',
  27.     'localeconv',
  28.     'strcoll',
  29.     'strxfrm',
  30.     'str',
  31.     'atof',
  32.     'atoi',
  33.     'format',
  34.     'format_string',
  35.     'currency',
  36.     'normalize',
  37.     'LC_CTYPE',
  38.     'LC_COLLATE',
  39.     'LC_TIME',
  40.     'LC_MONETARY',
  41.     'LC_NUMERIC',
  42.     'LC_ALL',
  43.     'CHAR_MAX']
  44.  
  45. try:
  46.     from _locale import *
  47. except ImportError:
  48.     CHAR_MAX = 127
  49.     LC_ALL = 6
  50.     LC_COLLATE = 3
  51.     LC_CTYPE = 0
  52.     LC_MESSAGES = 5
  53.     LC_MONETARY = 4
  54.     LC_NUMERIC = 1
  55.     LC_TIME = 2
  56.     Error = ValueError
  57.     
  58.     def localeconv():
  59.         ''' localeconv() -> dict.
  60.             Returns numeric and monetary locale-specific parameters.
  61.         '''
  62.         return {
  63.             'grouping': [
  64.                 127],
  65.             'currency_symbol': '',
  66.             'n_sign_posn': 127,
  67.             'p_cs_precedes': 127,
  68.             'n_cs_precedes': 127,
  69.             'mon_grouping': [],
  70.             'n_sep_by_space': 127,
  71.             'decimal_point': '.',
  72.             'negative_sign': '',
  73.             'positive_sign': '',
  74.             'p_sep_by_space': 127,
  75.             'int_curr_symbol': '',
  76.             'p_sign_posn': 127,
  77.             'thousands_sep': '',
  78.             'mon_thousands_sep': '',
  79.             'frac_digits': 127,
  80.             'mon_decimal_point': '',
  81.             'int_frac_digits': 127 }
  82.  
  83.     
  84.     def setlocale(category, value = None):
  85.         ''' setlocale(integer,string=None) -> string.
  86.             Activates/queries locale processing.
  87.         '''
  88.         if value not in (None, '', 'C'):
  89.             raise Error, '_locale emulation only supports "C" locale'
  90.         value not in (None, '', 'C')
  91.         return 'C'
  92.  
  93.     
  94.     def strcoll(a, b):
  95.         ''' strcoll(string,string) -> int.
  96.             Compares two strings according to the locale.
  97.         '''
  98.         return cmp(a, b)
  99.  
  100.     
  101.     def strxfrm(s):
  102.         ''' strxfrm(string) -> string.
  103.             Returns a string that behaves for cmp locale-aware.
  104.         '''
  105.         return s
  106.  
  107.  
  108. _localeconv = localeconv
  109. _override_localeconv = { }
  110.  
  111. def localeconv():
  112.     d = _localeconv()
  113.     if _override_localeconv:
  114.         d.update(_override_localeconv)
  115.     
  116.     return d
  117.  
  118. localeconv = functools.wraps(_localeconv)(localeconv)
  119.  
  120. def _grouping_intervals(grouping):
  121.     for interval in grouping:
  122.         if interval == CHAR_MAX:
  123.             return None
  124.         yield interval
  125.         None if interval == 0 else interval == CHAR_MAX
  126.         last_interval = interval
  127.     
  128.  
  129.  
  130. def _group(s, monetary = False):
  131.     conv = localeconv()
  132.     if not monetary or 'mon_thousands_sep':
  133.         pass
  134.     thousands_sep = conv['thousands_sep']
  135.     if not monetary or 'mon_grouping':
  136.         pass
  137.     grouping = conv['grouping']
  138.     if not grouping:
  139.         return (s, 0)
  140.     result = ''
  141.     seps = 0
  142.     if s[-1] == ' ':
  143.         stripped = s.rstrip()
  144.         right_spaces = s[len(stripped):]
  145.         s = stripped
  146.     else:
  147.         right_spaces = ''
  148.     left_spaces = ''
  149.     groups = []
  150.     for interval in _grouping_intervals(grouping):
  151.         if not s or s[-1] not in '0123456789':
  152.             left_spaces = s
  153.             s = ''
  154.             break
  155.         
  156.         groups.append(s[-interval:])
  157.         s = s[:-interval]
  158.     
  159.     if s:
  160.         groups.append(s)
  161.     
  162.     groups.reverse()
  163.     return (left_spaces + thousands_sep.join(groups) + right_spaces, len(thousands_sep) * (len(groups) - 1))
  164.  
  165.  
  166. def _strip_padding(s, amount):
  167.     lpos = 0
  168.     while amount and s[lpos] == ' ':
  169.         lpos += 1
  170.         amount -= 1
  171.     rpos = len(s) - 1
  172.     while amount and s[rpos] == ' ':
  173.         rpos -= 1
  174.         amount -= 1
  175.     return s[lpos:rpos + 1]
  176.  
  177.  
  178. def format(percent, value, grouping = False, monetary = False, *additional):
  179.     """Returns the locale-aware substitution of a %? specifier
  180.     (percent).
  181.  
  182.     additional is for format strings which contain one or more
  183.     '*' modifiers."""
  184.     if percent[0] != '%':
  185.         raise ValueError('format() must be given exactly one %char format specifier')
  186.     percent[0] != '%'
  187.     if additional:
  188.         formatted = percent % ((value,) + additional)
  189.     else:
  190.         formatted = percent % value
  191.     if percent[-1] in 'eEfFgG':
  192.         seps = 0
  193.         parts = formatted.split('.')
  194.         if grouping:
  195.             (parts[0], seps) = _group(parts[0], monetary = monetary)
  196.         
  197.         if not monetary or 'mon_decimal_point':
  198.             pass
  199.         decimal_point = localeconv()['decimal_point']
  200.         formatted = decimal_point.join(parts)
  201.         if seps:
  202.             formatted = _strip_padding(formatted, seps)
  203.         
  204.     elif percent[-1] in 'diu':
  205.         seps = 0
  206.         if grouping:
  207.             (formatted, seps) = _group(formatted, monetary = monetary)
  208.         
  209.         if seps:
  210.             formatted = _strip_padding(formatted, seps)
  211.         
  212.     
  213.     return formatted
  214.  
  215. import re
  216. import operator
  217. _percent_re = re.compile('%(?:\\((?P<key>.*?)\\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')
  218.  
  219. def format_string(f, val, grouping = False):
  220.     '''Formats a string in the same way that the % formatting would use,
  221.     but takes the current locale into account.
  222.     Grouping is applied if the third parameter is true.'''
  223.     percents = list(_percent_re.finditer(f))
  224.     new_f = _percent_re.sub('%s', f)
  225.     if isinstance(val, tuple):
  226.         new_val = list(val)
  227.         i = 0
  228.         for perc in percents:
  229.             starcount = perc.group('modifiers').count('*')
  230.             new_val[i] = format(perc.group(), new_val[i], grouping, False, *new_val[i + 1:i + 1 + starcount])
  231.             del new_val[i + 1:i + 1 + starcount]
  232.             i += 1 + starcount
  233.         
  234.         val = tuple(new_val)
  235.     elif operator.isMappingType(val):
  236.         for perc in percents:
  237.             key = perc.group('key')
  238.             val[key] = format(perc.group(), val[key], grouping)
  239.         
  240.     else:
  241.         val = format(percents[0].group(), val, grouping)
  242.     return new_f % val
  243.  
  244.  
  245. def currency(val, symbol = True, grouping = False, international = False):
  246.     '''Formats val according to the currency settings
  247.     in the current locale.'''
  248.     conv = localeconv()
  249.     if not international or 'int_frac_digits':
  250.         pass
  251.     digits = conv['frac_digits']
  252.     if digits == 127:
  253.         raise ValueError("Currency formatting is not possible using the 'C' locale.")
  254.     digits == 127
  255.     s = format('%%.%if' % digits, abs(val), grouping, monetary = True)
  256.     s = '<' + s + '>'
  257.     if symbol:
  258.         if not international or 'int_curr_symbol':
  259.             pass
  260.         smb = conv['currency_symbol']
  261.         if not val < 0 or 'n_cs_precedes':
  262.             pass
  263.         precedes = conv['p_cs_precedes']
  264.         if not val < 0 or 'n_sep_by_space':
  265.             pass
  266.         separated = conv['p_sep_by_space']
  267.         s = None + s if precedes else '' + smb
  268.     
  269.     if not val < 0 or 'n_sign_posn':
  270.         pass
  271.     sign_pos = conv['p_sign_posn']
  272.     if not val < 0 or 'negative_sign':
  273.         pass
  274.     sign = conv['positive_sign']
  275.     if sign_pos == 0:
  276.         s = '(' + s + ')'
  277.     elif sign_pos == 1:
  278.         s = sign + s
  279.     elif sign_pos == 2:
  280.         s = s + sign
  281.     elif sign_pos == 3:
  282.         s = s.replace('<', sign)
  283.     elif sign_pos == 4:
  284.         s = s.replace('>', sign)
  285.     else:
  286.         s = sign + s
  287.     return s.replace('<', '').replace('>', '')
  288.  
  289.  
  290. def str(val):
  291.     '''Convert float to integer, taking the locale into account.'''
  292.     return format('%.12g', val)
  293.  
  294.  
  295. def atof(string, func = float):
  296.     '''Parses a string as a float according to the locale settings.'''
  297.     ts = localeconv()['thousands_sep']
  298.     if ts:
  299.         string = string.replace(ts, '')
  300.     
  301.     dd = localeconv()['decimal_point']
  302.     if dd:
  303.         string = string.replace(dd, '.')
  304.     
  305.     return func(string)
  306.  
  307.  
  308. def atoi(str):
  309.     '''Converts a string to an integer according to the locale settings.'''
  310.     return atof(str, int)
  311.  
  312.  
  313. def _test():
  314.     setlocale(LC_ALL, '')
  315.     s1 = format('%d', 123456789, 1)
  316.     print s1, 'is', atoi(s1)
  317.     s1 = str(3.14)
  318.     print s1, 'is', atof(s1)
  319.  
  320. _setlocale = setlocale
  321.  
  322. def normalize(localename):
  323.     ''' Returns a normalized locale code for the given locale
  324.         name.
  325.  
  326.         The returned locale code is formatted for use with
  327.         setlocale().
  328.  
  329.         If normalization fails, the original name is returned
  330.         unchanged.
  331.  
  332.         If the given encoding is not known, the function defaults to
  333.         the default encoding for the locale code just like setlocale()
  334.         does.
  335.  
  336.     '''
  337.     fullname = localename.lower()
  338.     if ':' in fullname:
  339.         fullname = fullname.replace(':', '.')
  340.     
  341.     if '.' in fullname:
  342.         (langname, encoding) = fullname.split('.')[:2]
  343.         fullname = langname + '.' + encoding
  344.     else:
  345.         langname = fullname
  346.         encoding = ''
  347.     norm_encoding = encoding.replace('-', '')
  348.     norm_encoding = norm_encoding.replace('_', '')
  349.     lookup_name = langname + '.' + encoding
  350.     code = locale_alias.get(lookup_name, None)
  351.     if code is not None:
  352.         return code
  353.     code = locale_alias.get(langname, None)
  354.     if code is not None:
  355.         if '.' in code:
  356.             (langname, defenc) = code.split('.')
  357.         else:
  358.             langname = code
  359.             defenc = ''
  360.         if encoding:
  361.             norm_encoding = encodings.normalize_encoding(encoding)
  362.             norm_encoding = encodings.aliases.aliases.get(norm_encoding, norm_encoding)
  363.             encoding = locale_encoding_alias.get(norm_encoding, norm_encoding)
  364.         else:
  365.             encoding = defenc
  366.         if encoding:
  367.             return langname + '.' + encoding
  368.         return langname
  369.     code is not None
  370.     return localename
  371.  
  372.  
  373. def _parse_localename(localename):
  374.     ''' Parses the locale code for localename and returns the
  375.         result as tuple (language code, encoding).
  376.  
  377.         The localename is normalized and passed through the locale
  378.         alias engine. A ValueError is raised in case the locale name
  379.         cannot be parsed.
  380.  
  381.         The language code corresponds to RFC 1766.  code and encoding
  382.         can be None in case the values cannot be determined or are
  383.         unknown to this implementation.
  384.  
  385.     '''
  386.     code = normalize(localename)
  387.     if '@' in code:
  388.         (code, modifier) = code.split('@')
  389.         if modifier == 'euro' and '.' not in code:
  390.             return (code, 'iso-8859-15')
  391.     
  392.     if '.' in code:
  393.         return tuple(code.split('.')[:2])
  394.     if code == 'C':
  395.         return (None, None)
  396.     raise ValueError, 'unknown locale: %s' % localename
  397.  
  398.  
  399. def _build_localename(localetuple):
  400.     ''' Builds a locale code from the given tuple (language code,
  401.         encoding).
  402.  
  403.         No aliasing or normalizing takes place.
  404.  
  405.     '''
  406.     (language, encoding) = localetuple
  407.     if language is None:
  408.         language = 'C'
  409.     
  410.     if encoding is None:
  411.         return language
  412.     return language + '.' + encoding
  413.  
  414.  
  415. def getdefaultlocale(envvars = ('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
  416.     ''' Tries to determine the default locale settings and returns
  417.         them as tuple (language code, encoding).
  418.  
  419.         According to POSIX, a program which has not called
  420.         setlocale(LC_ALL, "") runs using the portable \'C\' locale.
  421.         Calling setlocale(LC_ALL, "") lets it use the default locale as
  422.         defined by the LANG variable. Since we don\'t want to interfere
  423.         with the current locale setting we thus emulate the behavior
  424.         in the way described above.
  425.  
  426.         To maintain compatibility with other platforms, not only the
  427.         LANG variable is tested, but a list of variables given as
  428.         envvars parameter. The first found to be defined will be
  429.         used. envvars defaults to the search path used in GNU gettext;
  430.         it must always contain the variable name \'LANG\'.
  431.  
  432.         Except for the code \'C\', the language code corresponds to RFC
  433.         1766.  code and encoding can be None in case the values cannot
  434.         be determined.
  435.  
  436.     '''
  437.     
  438.     try:
  439.         import _locale as _locale
  440.         (code, encoding) = _locale._getdefaultlocale()
  441.     except (ImportError, AttributeError):
  442.         pass
  443.  
  444.     if sys.platform == 'win32' and code and code[:2] == '0x':
  445.         code = windows_locale.get(int(code, 0))
  446.     
  447.     return (code, encoding)
  448.     import os as os
  449.     lookup = os.environ.get
  450.     for variable in envvars:
  451.         localename = lookup(variable, None)
  452.         if localename:
  453.             if variable == 'LANGUAGE':
  454.                 localename = localename.split(':')[0]
  455.             
  456.             break
  457.             continue
  458.     else:
  459.         localename = 'C'
  460.     return _parse_localename(localename)
  461.  
  462.  
  463. def getlocale(category = LC_CTYPE):
  464.     """ Returns the current setting for the given locale category as
  465.         tuple (language code, encoding).
  466.  
  467.         category may be one of the LC_* value except LC_ALL. It
  468.         defaults to LC_CTYPE.
  469.  
  470.         Except for the code 'C', the language code corresponds to RFC
  471.         1766.  code and encoding can be None in case the values cannot
  472.         be determined.
  473.  
  474.     """
  475.     localename = _setlocale(category)
  476.     if category == LC_ALL and ';' in localename:
  477.         raise TypeError, 'category LC_ALL is not supported'
  478.     ';' in localename
  479.     return _parse_localename(localename)
  480.  
  481.  
  482. def setlocale(category, locale = None):
  483.     ''' Set the locale for the given category.  The locale can be
  484.         a string, a locale tuple (language code, encoding), or None.
  485.  
  486.         Locale tuples are converted to strings the locale aliasing
  487.         engine.  Locale strings are passed directly to the C lib.
  488.  
  489.         category may be given as one of the LC_* values.
  490.  
  491.     '''
  492.     if locale and type(locale) is not type(''):
  493.         locale = normalize(_build_localename(locale))
  494.     
  495.     return _setlocale(category, locale)
  496.  
  497.  
  498. def resetlocale(category = LC_ALL):
  499.     ''' Sets the locale for category to the default setting.
  500.  
  501.         The default setting is determined by calling
  502.         getdefaultlocale(). category defaults to LC_ALL.
  503.  
  504.     '''
  505.     _setlocale(category, _build_localename(getdefaultlocale()))
  506.  
  507. if sys.platform in ('win32', 'darwin', 'mac'):
  508.     
  509.     def getpreferredencoding(do_setlocale = True):
  510.         '''Return the charset that the user is likely using.'''
  511.         import _locale
  512.         return _locale._getdefaultlocale()[1]
  513.  
  514. else:
  515.     
  516.     try:
  517.         CODESET
  518.     except NameError:
  519.         
  520.         def getpreferredencoding(do_setlocale = True):
  521.             '''Return the charset that the user is likely using,
  522.             by looking at environment variables.'''
  523.             return getdefaultlocale()[1]
  524.  
  525.  
  526.     
  527.     def getpreferredencoding(do_setlocale = True):
  528.         '''Return the charset that the user is likely using,
  529.             according to the system configuration.'''
  530.         if do_setlocale:
  531.             oldloc = setlocale(LC_CTYPE)
  532.             
  533.             try:
  534.                 setlocale(LC_CTYPE, '')
  535.             except Error:
  536.                 pass
  537.  
  538.             result = nl_langinfo(CODESET)
  539.             setlocale(LC_CTYPE, oldloc)
  540.             return result
  541.         return nl_langinfo(CODESET)
  542.  
  543. locale_encoding_alias = {
  544.     '437': 'C',
  545.     'c': 'C',
  546.     'en': 'ISO8859-1',
  547.     'jis': 'JIS7',
  548.     'jis7': 'JIS7',
  549.     'ajec': 'eucJP',
  550.     'ascii': 'ISO8859-1',
  551.     'latin_1': 'ISO8859-1',
  552.     'iso8859_1': 'ISO8859-1',
  553.     'iso8859_10': 'ISO8859-10',
  554.     'iso8859_11': 'ISO8859-11',
  555.     'iso8859_13': 'ISO8859-13',
  556.     'iso8859_14': 'ISO8859-14',
  557.     'iso8859_15': 'ISO8859-15',
  558.     'iso8859_2': 'ISO8859-2',
  559.     'iso8859_3': 'ISO8859-3',
  560.     'iso8859_4': 'ISO8859-4',
  561.     'iso8859_5': 'ISO8859-5',
  562.     'iso8859_6': 'ISO8859-6',
  563.     'iso8859_7': 'ISO8859-7',
  564.     'iso8859_8': 'ISO8859-8',
  565.     'iso8859_9': 'ISO8859-9',
  566.     'iso2022_jp': 'JIS7',
  567.     'shift_jis': 'SJIS',
  568.     'tactis': 'TACTIS',
  569.     'euc_jp': 'eucJP',
  570.     'euc_kr': 'eucKR',
  571.     'utf_8': 'UTF8',
  572.     'koi8_r': 'KOI8-R',
  573.     'koi8_u': 'KOI8-U' }
  574. locale_alias = {
  575.     'a3': 'a3_AZ.KOI8-C',
  576.     'a3_az': 'a3_AZ.KOI8-C',
  577.     'a3_az.koi8c': 'a3_AZ.KOI8-C',
  578.     'af': 'af_ZA.ISO8859-1',
  579.     'af_za': 'af_ZA.ISO8859-1',
  580.     'af_za.iso88591': 'af_ZA.ISO8859-1',
  581.     'am': 'am_ET.UTF-8',
  582.     'am_et': 'am_ET.UTF-8',
  583.     'american': 'en_US.ISO8859-1',
  584.     'american.iso88591': 'en_US.ISO8859-1',
  585.     'ar': 'ar_AA.ISO8859-6',
  586.     'ar_aa': 'ar_AA.ISO8859-6',
  587.     'ar_aa.iso88596': 'ar_AA.ISO8859-6',
  588.     'ar_ae': 'ar_AE.ISO8859-6',
  589.     'ar_ae.iso88596': 'ar_AE.ISO8859-6',
  590.     'ar_bh': 'ar_BH.ISO8859-6',
  591.     'ar_bh.iso88596': 'ar_BH.ISO8859-6',
  592.     'ar_dz': 'ar_DZ.ISO8859-6',
  593.     'ar_dz.iso88596': 'ar_DZ.ISO8859-6',
  594.     'ar_eg': 'ar_EG.ISO8859-6',
  595.     'ar_eg.iso88596': 'ar_EG.ISO8859-6',
  596.     'ar_iq': 'ar_IQ.ISO8859-6',
  597.     'ar_iq.iso88596': 'ar_IQ.ISO8859-6',
  598.     'ar_jo': 'ar_JO.ISO8859-6',
  599.     'ar_jo.iso88596': 'ar_JO.ISO8859-6',
  600.     'ar_kw': 'ar_KW.ISO8859-6',
  601.     'ar_kw.iso88596': 'ar_KW.ISO8859-6',
  602.     'ar_lb': 'ar_LB.ISO8859-6',
  603.     'ar_lb.iso88596': 'ar_LB.ISO8859-6',
  604.     'ar_ly': 'ar_LY.ISO8859-6',
  605.     'ar_ly.iso88596': 'ar_LY.ISO8859-6',
  606.     'ar_ma': 'ar_MA.ISO8859-6',
  607.     'ar_ma.iso88596': 'ar_MA.ISO8859-6',
  608.     'ar_om': 'ar_OM.ISO8859-6',
  609.     'ar_om.iso88596': 'ar_OM.ISO8859-6',
  610.     'ar_qa': 'ar_QA.ISO8859-6',
  611.     'ar_qa.iso88596': 'ar_QA.ISO8859-6',
  612.     'ar_sa': 'ar_SA.ISO8859-6',
  613.     'ar_sa.iso88596': 'ar_SA.ISO8859-6',
  614.     'ar_sd': 'ar_SD.ISO8859-6',
  615.     'ar_sd.iso88596': 'ar_SD.ISO8859-6',
  616.     'ar_sy': 'ar_SY.ISO8859-6',
  617.     'ar_sy.iso88596': 'ar_SY.ISO8859-6',
  618.     'ar_tn': 'ar_TN.ISO8859-6',
  619.     'ar_tn.iso88596': 'ar_TN.ISO8859-6',
  620.     'ar_ye': 'ar_YE.ISO8859-6',
  621.     'ar_ye.iso88596': 'ar_YE.ISO8859-6',
  622.     'arabic': 'ar_AA.ISO8859-6',
  623.     'arabic.iso88596': 'ar_AA.ISO8859-6',
  624.     'az': 'az_AZ.ISO8859-9E',
  625.     'az_az': 'az_AZ.ISO8859-9E',
  626.     'az_az.iso88599e': 'az_AZ.ISO8859-9E',
  627.     'be': 'be_BY.CP1251',
  628.     'be_by': 'be_BY.CP1251',
  629.     'be_by.cp1251': 'be_BY.CP1251',
  630.     'be_by.microsoftcp1251': 'be_BY.CP1251',
  631.     'bg': 'bg_BG.CP1251',
  632.     'bg_bg': 'bg_BG.CP1251',
  633.     'bg_bg.cp1251': 'bg_BG.CP1251',
  634.     'bg_bg.iso88595': 'bg_BG.ISO8859-5',
  635.     'bg_bg.koi8r': 'bg_BG.KOI8-R',
  636.     'bg_bg.microsoftcp1251': 'bg_BG.CP1251',
  637.     'bn_in': 'bn_IN.UTF-8',
  638.     'bokmal': 'nb_NO.ISO8859-1',
  639.     'bokm\xe5l': 'nb_NO.ISO8859-1',
  640.     'br': 'br_FR.ISO8859-1',
  641.     'br_fr': 'br_FR.ISO8859-1',
  642.     'br_fr.iso88591': 'br_FR.ISO8859-1',
  643.     'br_fr.iso885914': 'br_FR.ISO8859-14',
  644.     'br_fr.iso885915': 'br_FR.ISO8859-15',
  645.     'br_fr.iso885915@euro': 'br_FR.ISO8859-15',
  646.     'br_fr.utf8@euro': 'br_FR.UTF-8',
  647.     'br_fr@euro': 'br_FR.ISO8859-15',
  648.     'bs': 'bs_BA.ISO8859-2',
  649.     'bs_ba': 'bs_BA.ISO8859-2',
  650.     'bs_ba.iso88592': 'bs_BA.ISO8859-2',
  651.     'bulgarian': 'bg_BG.CP1251',
  652.     'c': 'C',
  653.     'c-french': 'fr_CA.ISO8859-1',
  654.     'c-french.iso88591': 'fr_CA.ISO8859-1',
  655.     'c.en': 'C',
  656.     'c.iso88591': 'en_US.ISO8859-1',
  657.     'c_c': 'C',
  658.     'c_c.c': 'C',
  659.     'ca': 'ca_ES.ISO8859-1',
  660.     'ca_es': 'ca_ES.ISO8859-1',
  661.     'ca_es.iso88591': 'ca_ES.ISO8859-1',
  662.     'ca_es.iso885915': 'ca_ES.ISO8859-15',
  663.     'ca_es.iso885915@euro': 'ca_ES.ISO8859-15',
  664.     'ca_es.utf8@euro': 'ca_ES.UTF-8',
  665.     'ca_es@euro': 'ca_ES.ISO8859-15',
  666.     'catalan': 'ca_ES.ISO8859-1',
  667.     'cextend': 'en_US.ISO8859-1',
  668.     'cextend.en': 'en_US.ISO8859-1',
  669.     'chinese-s': 'zh_CN.eucCN',
  670.     'chinese-t': 'zh_TW.eucTW',
  671.     'croatian': 'hr_HR.ISO8859-2',
  672.     'cs': 'cs_CZ.ISO8859-2',
  673.     'cs_cs': 'cs_CZ.ISO8859-2',
  674.     'cs_cs.iso88592': 'cs_CS.ISO8859-2',
  675.     'cs_cz': 'cs_CZ.ISO8859-2',
  676.     'cs_cz.iso88592': 'cs_CZ.ISO8859-2',
  677.     'cy': 'cy_GB.ISO8859-1',
  678.     'cy_gb': 'cy_GB.ISO8859-1',
  679.     'cy_gb.iso88591': 'cy_GB.ISO8859-1',
  680.     'cy_gb.iso885914': 'cy_GB.ISO8859-14',
  681.     'cy_gb.iso885915': 'cy_GB.ISO8859-15',
  682.     'cy_gb@euro': 'cy_GB.ISO8859-15',
  683.     'cz': 'cs_CZ.ISO8859-2',
  684.     'cz_cz': 'cs_CZ.ISO8859-2',
  685.     'czech': 'cs_CZ.ISO8859-2',
  686.     'da': 'da_DK.ISO8859-1',
  687.     'da_dk': 'da_DK.ISO8859-1',
  688.     'da_dk.88591': 'da_DK.ISO8859-1',
  689.     'da_dk.885915': 'da_DK.ISO8859-15',
  690.     'da_dk.iso88591': 'da_DK.ISO8859-1',
  691.     'da_dk.iso885915': 'da_DK.ISO8859-15',
  692.     'da_dk@euro': 'da_DK.ISO8859-15',
  693.     'danish': 'da_DK.ISO8859-1',
  694.     'danish.iso88591': 'da_DK.ISO8859-1',
  695.     'dansk': 'da_DK.ISO8859-1',
  696.     'de': 'de_DE.ISO8859-1',
  697.     'de_at': 'de_AT.ISO8859-1',
  698.     'de_at.iso88591': 'de_AT.ISO8859-1',
  699.     'de_at.iso885915': 'de_AT.ISO8859-15',
  700.     'de_at.iso885915@euro': 'de_AT.ISO8859-15',
  701.     'de_at.utf8@euro': 'de_AT.UTF-8',
  702.     'de_at@euro': 'de_AT.ISO8859-15',
  703.     'de_be': 'de_BE.ISO8859-1',
  704.     'de_be.iso88591': 'de_BE.ISO8859-1',
  705.     'de_be.iso885915': 'de_BE.ISO8859-15',
  706.     'de_be.iso885915@euro': 'de_BE.ISO8859-15',
  707.     'de_be.utf8@euro': 'de_BE.UTF-8',
  708.     'de_be@euro': 'de_BE.ISO8859-15',
  709.     'de_ch': 'de_CH.ISO8859-1',
  710.     'de_ch.iso88591': 'de_CH.ISO8859-1',
  711.     'de_ch.iso885915': 'de_CH.ISO8859-15',
  712.     'de_ch@euro': 'de_CH.ISO8859-15',
  713.     'de_de': 'de_DE.ISO8859-1',
  714.     'de_de.88591': 'de_DE.ISO8859-1',
  715.     'de_de.885915': 'de_DE.ISO8859-15',
  716.     'de_de.885915@euro': 'de_DE.ISO8859-15',
  717.     'de_de.iso88591': 'de_DE.ISO8859-1',
  718.     'de_de.iso885915': 'de_DE.ISO8859-15',
  719.     'de_de.iso885915@euro': 'de_DE.ISO8859-15',
  720.     'de_de.utf8@euro': 'de_DE.UTF-8',
  721.     'de_de@euro': 'de_DE.ISO8859-15',
  722.     'de_lu': 'de_LU.ISO8859-1',
  723.     'de_lu.iso88591': 'de_LU.ISO8859-1',
  724.     'de_lu.iso885915': 'de_LU.ISO8859-15',
  725.     'de_lu.iso885915@euro': 'de_LU.ISO8859-15',
  726.     'de_lu.utf8@euro': 'de_LU.UTF-8',
  727.     'de_lu@euro': 'de_LU.ISO8859-15',
  728.     'deutsch': 'de_DE.ISO8859-1',
  729.     'dutch': 'nl_NL.ISO8859-1',
  730.     'dutch.iso88591': 'nl_BE.ISO8859-1',
  731.     'ee': 'ee_EE.ISO8859-4',
  732.     'ee_ee': 'ee_EE.ISO8859-4',
  733.     'ee_ee.iso88594': 'ee_EE.ISO8859-4',
  734.     'eesti': 'et_EE.ISO8859-1',
  735.     'el': 'el_GR.ISO8859-7',
  736.     'el_gr': 'el_GR.ISO8859-7',
  737.     'el_gr.iso88597': 'el_GR.ISO8859-7',
  738.     'el_gr@euro': 'el_GR.ISO8859-15',
  739.     'en': 'en_US.ISO8859-1',
  740.     'en.iso88591': 'en_US.ISO8859-1',
  741.     'en_au': 'en_AU.ISO8859-1',
  742.     'en_au.iso88591': 'en_AU.ISO8859-1',
  743.     'en_be': 'en_BE.ISO8859-1',
  744.     'en_be@euro': 'en_BE.ISO8859-15',
  745.     'en_bw': 'en_BW.ISO8859-1',
  746.     'en_bw.iso88591': 'en_BW.ISO8859-1',
  747.     'en_ca': 'en_CA.ISO8859-1',
  748.     'en_ca.iso88591': 'en_CA.ISO8859-1',
  749.     'en_gb': 'en_GB.ISO8859-1',
  750.     'en_gb.88591': 'en_GB.ISO8859-1',
  751.     'en_gb.iso88591': 'en_GB.ISO8859-1',
  752.     'en_gb.iso885915': 'en_GB.ISO8859-15',
  753.     'en_gb@euro': 'en_GB.ISO8859-15',
  754.     'en_hk': 'en_HK.ISO8859-1',
  755.     'en_hk.iso88591': 'en_HK.ISO8859-1',
  756.     'en_ie': 'en_IE.ISO8859-1',
  757.     'en_ie.iso88591': 'en_IE.ISO8859-1',
  758.     'en_ie.iso885915': 'en_IE.ISO8859-15',
  759.     'en_ie.iso885915@euro': 'en_IE.ISO8859-15',
  760.     'en_ie.utf8@euro': 'en_IE.UTF-8',
  761.     'en_ie@euro': 'en_IE.ISO8859-15',
  762.     'en_in': 'en_IN.ISO8859-1',
  763.     'en_nz': 'en_NZ.ISO8859-1',
  764.     'en_nz.iso88591': 'en_NZ.ISO8859-1',
  765.     'en_ph': 'en_PH.ISO8859-1',
  766.     'en_ph.iso88591': 'en_PH.ISO8859-1',
  767.     'en_sg': 'en_SG.ISO8859-1',
  768.     'en_sg.iso88591': 'en_SG.ISO8859-1',
  769.     'en_uk': 'en_GB.ISO8859-1',
  770.     'en_us': 'en_US.ISO8859-1',
  771.     'en_us.88591': 'en_US.ISO8859-1',
  772.     'en_us.885915': 'en_US.ISO8859-15',
  773.     'en_us.iso88591': 'en_US.ISO8859-1',
  774.     'en_us.iso885915': 'en_US.ISO8859-15',
  775.     'en_us.iso885915@euro': 'en_US.ISO8859-15',
  776.     'en_us@euro': 'en_US.ISO8859-15',
  777.     'en_us@euro@euro': 'en_US.ISO8859-15',
  778.     'en_za': 'en_ZA.ISO8859-1',
  779.     'en_za.88591': 'en_ZA.ISO8859-1',
  780.     'en_za.iso88591': 'en_ZA.ISO8859-1',
  781.     'en_za.iso885915': 'en_ZA.ISO8859-15',
  782.     'en_za@euro': 'en_ZA.ISO8859-15',
  783.     'en_zw': 'en_ZW.ISO8859-1',
  784.     'en_zw.iso88591': 'en_ZW.ISO8859-1',
  785.     'eng_gb': 'en_GB.ISO8859-1',
  786.     'eng_gb.8859': 'en_GB.ISO8859-1',
  787.     'english': 'en_EN.ISO8859-1',
  788.     'english.iso88591': 'en_EN.ISO8859-1',
  789.     'english_uk': 'en_GB.ISO8859-1',
  790.     'english_uk.8859': 'en_GB.ISO8859-1',
  791.     'english_united-states': 'en_US.ISO8859-1',
  792.     'english_united-states.437': 'C',
  793.     'english_us': 'en_US.ISO8859-1',
  794.     'english_us.8859': 'en_US.ISO8859-1',
  795.     'english_us.ascii': 'en_US.ISO8859-1',
  796.     'eo': 'eo_XX.ISO8859-3',
  797.     'eo_eo': 'eo_EO.ISO8859-3',
  798.     'eo_eo.iso88593': 'eo_EO.ISO8859-3',
  799.     'eo_xx': 'eo_XX.ISO8859-3',
  800.     'eo_xx.iso88593': 'eo_XX.ISO8859-3',
  801.     'es': 'es_ES.ISO8859-1',
  802.     'es_ar': 'es_AR.ISO8859-1',
  803.     'es_ar.iso88591': 'es_AR.ISO8859-1',
  804.     'es_bo': 'es_BO.ISO8859-1',
  805.     'es_bo.iso88591': 'es_BO.ISO8859-1',
  806.     'es_cl': 'es_CL.ISO8859-1',
  807.     'es_cl.iso88591': 'es_CL.ISO8859-1',
  808.     'es_co': 'es_CO.ISO8859-1',
  809.     'es_co.iso88591': 'es_CO.ISO8859-1',
  810.     'es_cr': 'es_CR.ISO8859-1',
  811.     'es_cr.iso88591': 'es_CR.ISO8859-1',
  812.     'es_do': 'es_DO.ISO8859-1',
  813.     'es_do.iso88591': 'es_DO.ISO8859-1',
  814.     'es_ec': 'es_EC.ISO8859-1',
  815.     'es_ec.iso88591': 'es_EC.ISO8859-1',
  816.     'es_es': 'es_ES.ISO8859-1',
  817.     'es_es.88591': 'es_ES.ISO8859-1',
  818.     'es_es.iso88591': 'es_ES.ISO8859-1',
  819.     'es_es.iso885915': 'es_ES.ISO8859-15',
  820.     'es_es.iso885915@euro': 'es_ES.ISO8859-15',
  821.     'es_es.utf8@euro': 'es_ES.UTF-8',
  822.     'es_es@euro': 'es_ES.ISO8859-15',
  823.     'es_gt': 'es_GT.ISO8859-1',
  824.     'es_gt.iso88591': 'es_GT.ISO8859-1',
  825.     'es_hn': 'es_HN.ISO8859-1',
  826.     'es_hn.iso88591': 'es_HN.ISO8859-1',
  827.     'es_mx': 'es_MX.ISO8859-1',
  828.     'es_mx.iso88591': 'es_MX.ISO8859-1',
  829.     'es_ni': 'es_NI.ISO8859-1',
  830.     'es_ni.iso88591': 'es_NI.ISO8859-1',
  831.     'es_pa': 'es_PA.ISO8859-1',
  832.     'es_pa.iso88591': 'es_PA.ISO8859-1',
  833.     'es_pa.iso885915': 'es_PA.ISO8859-15',
  834.     'es_pa@euro': 'es_PA.ISO8859-15',
  835.     'es_pe': 'es_PE.ISO8859-1',
  836.     'es_pe.iso88591': 'es_PE.ISO8859-1',
  837.     'es_pe.iso885915': 'es_PE.ISO8859-15',
  838.     'es_pe@euro': 'es_PE.ISO8859-15',
  839.     'es_pr': 'es_PR.ISO8859-1',
  840.     'es_pr.iso88591': 'es_PR.ISO8859-1',
  841.     'es_py': 'es_PY.ISO8859-1',
  842.     'es_py.iso88591': 'es_PY.ISO8859-1',
  843.     'es_py.iso885915': 'es_PY.ISO8859-15',
  844.     'es_py@euro': 'es_PY.ISO8859-15',
  845.     'es_sv': 'es_SV.ISO8859-1',
  846.     'es_sv.iso88591': 'es_SV.ISO8859-1',
  847.     'es_sv.iso885915': 'es_SV.ISO8859-15',
  848.     'es_sv@euro': 'es_SV.ISO8859-15',
  849.     'es_us': 'es_US.ISO8859-1',
  850.     'es_us.iso88591': 'es_US.ISO8859-1',
  851.     'es_uy': 'es_UY.ISO8859-1',
  852.     'es_uy.iso88591': 'es_UY.ISO8859-1',
  853.     'es_uy.iso885915': 'es_UY.ISO8859-15',
  854.     'es_uy@euro': 'es_UY.ISO8859-15',
  855.     'es_ve': 'es_VE.ISO8859-1',
  856.     'es_ve.iso88591': 'es_VE.ISO8859-1',
  857.     'es_ve.iso885915': 'es_VE.ISO8859-15',
  858.     'es_ve@euro': 'es_VE.ISO8859-15',
  859.     'estonian': 'et_EE.ISO8859-1',
  860.     'et': 'et_EE.ISO8859-15',
  861.     'et_ee': 'et_EE.ISO8859-15',
  862.     'et_ee.iso88591': 'et_EE.ISO8859-1',
  863.     'et_ee.iso885913': 'et_EE.ISO8859-13',
  864.     'et_ee.iso885915': 'et_EE.ISO8859-15',
  865.     'et_ee.iso88594': 'et_EE.ISO8859-4',
  866.     'et_ee@euro': 'et_EE.ISO8859-15',
  867.     'eu': 'eu_ES.ISO8859-1',
  868.     'eu_es': 'eu_ES.ISO8859-1',
  869.     'eu_es.iso88591': 'eu_ES.ISO8859-1',
  870.     'eu_es.iso885915': 'eu_ES.ISO8859-15',
  871.     'eu_es.iso885915@euro': 'eu_ES.ISO8859-15',
  872.     'eu_es.utf8@euro': 'eu_ES.UTF-8',
  873.     'eu_es@euro': 'eu_ES.ISO8859-15',
  874.     'fa': 'fa_IR.UTF-8',
  875.     'fa_ir': 'fa_IR.UTF-8',
  876.     'fa_ir.isiri3342': 'fa_IR.ISIRI-3342',
  877.     'fi': 'fi_FI.ISO8859-15',
  878.     'fi_fi': 'fi_FI.ISO8859-15',
  879.     'fi_fi.88591': 'fi_FI.ISO8859-1',
  880.     'fi_fi.iso88591': 'fi_FI.ISO8859-1',
  881.     'fi_fi.iso885915': 'fi_FI.ISO8859-15',
  882.     'fi_fi.iso885915@euro': 'fi_FI.ISO8859-15',
  883.     'fi_fi.utf8@euro': 'fi_FI.UTF-8',
  884.     'fi_fi@euro': 'fi_FI.ISO8859-15',
  885.     'finnish': 'fi_FI.ISO8859-1',
  886.     'finnish.iso88591': 'fi_FI.ISO8859-1',
  887.     'fo': 'fo_FO.ISO8859-1',
  888.     'fo_fo': 'fo_FO.ISO8859-1',
  889.     'fo_fo.iso88591': 'fo_FO.ISO8859-1',
  890.     'fo_fo.iso885915': 'fo_FO.ISO8859-15',
  891.     'fo_fo@euro': 'fo_FO.ISO8859-15',
  892.     'fr': 'fr_FR.ISO8859-1',
  893.     'fr_be': 'fr_BE.ISO8859-1',
  894.     'fr_be.88591': 'fr_BE.ISO8859-1',
  895.     'fr_be.iso88591': 'fr_BE.ISO8859-1',
  896.     'fr_be.iso885915': 'fr_BE.ISO8859-15',
  897.     'fr_be.iso885915@euro': 'fr_BE.ISO8859-15',
  898.     'fr_be.utf8@euro': 'fr_BE.UTF-8',
  899.     'fr_be@euro': 'fr_BE.ISO8859-15',
  900.     'fr_ca': 'fr_CA.ISO8859-1',
  901.     'fr_ca.88591': 'fr_CA.ISO8859-1',
  902.     'fr_ca.iso88591': 'fr_CA.ISO8859-1',
  903.     'fr_ca.iso885915': 'fr_CA.ISO8859-15',
  904.     'fr_ca@euro': 'fr_CA.ISO8859-15',
  905.     'fr_ch': 'fr_CH.ISO8859-1',
  906.     'fr_ch.88591': 'fr_CH.ISO8859-1',
  907.     'fr_ch.iso88591': 'fr_CH.ISO8859-1',
  908.     'fr_ch.iso885915': 'fr_CH.ISO8859-15',
  909.     'fr_ch@euro': 'fr_CH.ISO8859-15',
  910.     'fr_fr': 'fr_FR.ISO8859-1',
  911.     'fr_fr.88591': 'fr_FR.ISO8859-1',
  912.     'fr_fr.iso88591': 'fr_FR.ISO8859-1',
  913.     'fr_fr.iso885915': 'fr_FR.ISO8859-15',
  914.     'fr_fr.iso885915@euro': 'fr_FR.ISO8859-15',
  915.     'fr_fr.utf8@euro': 'fr_FR.UTF-8',
  916.     'fr_fr@euro': 'fr_FR.ISO8859-15',
  917.     'fr_lu': 'fr_LU.ISO8859-1',
  918.     'fr_lu.88591': 'fr_LU.ISO8859-1',
  919.     'fr_lu.iso88591': 'fr_LU.ISO8859-1',
  920.     'fr_lu.iso885915': 'fr_LU.ISO8859-15',
  921.     'fr_lu.iso885915@euro': 'fr_LU.ISO8859-15',
  922.     'fr_lu.utf8@euro': 'fr_LU.UTF-8',
  923.     'fr_lu@euro': 'fr_LU.ISO8859-15',
  924.     'fran\xe7ais': 'fr_FR.ISO8859-1',
  925.     'fre_fr': 'fr_FR.ISO8859-1',
  926.     'fre_fr.8859': 'fr_FR.ISO8859-1',
  927.     'french': 'fr_FR.ISO8859-1',
  928.     'french.iso88591': 'fr_CH.ISO8859-1',
  929.     'french_france': 'fr_FR.ISO8859-1',
  930.     'french_france.8859': 'fr_FR.ISO8859-1',
  931.     'ga': 'ga_IE.ISO8859-1',
  932.     'ga_ie': 'ga_IE.ISO8859-1',
  933.     'ga_ie.iso88591': 'ga_IE.ISO8859-1',
  934.     'ga_ie.iso885914': 'ga_IE.ISO8859-14',
  935.     'ga_ie.iso885915': 'ga_IE.ISO8859-15',
  936.     'ga_ie.iso885915@euro': 'ga_IE.ISO8859-15',
  937.     'ga_ie.utf8@euro': 'ga_IE.UTF-8',
  938.     'ga_ie@euro': 'ga_IE.ISO8859-15',
  939.     'galego': 'gl_ES.ISO8859-1',
  940.     'galician': 'gl_ES.ISO8859-1',
  941.     'gd': 'gd_GB.ISO8859-1',
  942.     'gd_gb': 'gd_GB.ISO8859-1',
  943.     'gd_gb.iso88591': 'gd_GB.ISO8859-1',
  944.     'gd_gb.iso885914': 'gd_GB.ISO8859-14',
  945.     'gd_gb.iso885915': 'gd_GB.ISO8859-15',
  946.     'gd_gb@euro': 'gd_GB.ISO8859-15',
  947.     'ger_de': 'de_DE.ISO8859-1',
  948.     'ger_de.8859': 'de_DE.ISO8859-1',
  949.     'german': 'de_DE.ISO8859-1',
  950.     'german.iso88591': 'de_CH.ISO8859-1',
  951.     'german_germany': 'de_DE.ISO8859-1',
  952.     'german_germany.8859': 'de_DE.ISO8859-1',
  953.     'gl': 'gl_ES.ISO8859-1',
  954.     'gl_es': 'gl_ES.ISO8859-1',
  955.     'gl_es.iso88591': 'gl_ES.ISO8859-1',
  956.     'gl_es.iso885915': 'gl_ES.ISO8859-15',
  957.     'gl_es.iso885915@euro': 'gl_ES.ISO8859-15',
  958.     'gl_es.utf8@euro': 'gl_ES.UTF-8',
  959.     'gl_es@euro': 'gl_ES.ISO8859-15',
  960.     'greek': 'el_GR.ISO8859-7',
  961.     'greek.iso88597': 'el_GR.ISO8859-7',
  962.     'gu_in': 'gu_IN.UTF-8',
  963.     'gv': 'gv_GB.ISO8859-1',
  964.     'gv_gb': 'gv_GB.ISO8859-1',
  965.     'gv_gb.iso88591': 'gv_GB.ISO8859-1',
  966.     'gv_gb.iso885914': 'gv_GB.ISO8859-14',
  967.     'gv_gb.iso885915': 'gv_GB.ISO8859-15',
  968.     'gv_gb@euro': 'gv_GB.ISO8859-15',
  969.     'he': 'he_IL.ISO8859-8',
  970.     'he_il': 'he_IL.ISO8859-8',
  971.     'he_il.cp1255': 'he_IL.CP1255',
  972.     'he_il.iso88598': 'he_IL.ISO8859-8',
  973.     'he_il.microsoftcp1255': 'he_IL.CP1255',
  974.     'hebrew': 'iw_IL.ISO8859-8',
  975.     'hebrew.iso88598': 'iw_IL.ISO8859-8',
  976.     'hi': 'hi_IN.ISCII-DEV',
  977.     'hi_in': 'hi_IN.ISCII-DEV',
  978.     'hi_in.isciidev': 'hi_IN.ISCII-DEV',
  979.     'hr': 'hr_HR.ISO8859-2',
  980.     'hr_hr': 'hr_HR.ISO8859-2',
  981.     'hr_hr.iso88592': 'hr_HR.ISO8859-2',
  982.     'hrvatski': 'hr_HR.ISO8859-2',
  983.     'hu': 'hu_HU.ISO8859-2',
  984.     'hu_hu': 'hu_HU.ISO8859-2',
  985.     'hu_hu.iso88592': 'hu_HU.ISO8859-2',
  986.     'hungarian': 'hu_HU.ISO8859-2',
  987.     'icelandic': 'is_IS.ISO8859-1',
  988.     'icelandic.iso88591': 'is_IS.ISO8859-1',
  989.     'id': 'id_ID.ISO8859-1',
  990.     'id_id': 'id_ID.ISO8859-1',
  991.     'in': 'id_ID.ISO8859-1',
  992.     'in_id': 'id_ID.ISO8859-1',
  993.     'is': 'is_IS.ISO8859-1',
  994.     'is_is': 'is_IS.ISO8859-1',
  995.     'is_is.iso88591': 'is_IS.ISO8859-1',
  996.     'is_is.iso885915': 'is_IS.ISO8859-15',
  997.     'is_is@euro': 'is_IS.ISO8859-15',
  998.     'iso-8859-1': 'en_US.ISO8859-1',
  999.     'iso-8859-15': 'en_US.ISO8859-15',
  1000.     'iso8859-1': 'en_US.ISO8859-1',
  1001.     'iso8859-15': 'en_US.ISO8859-15',
  1002.     'iso_8859_1': 'en_US.ISO8859-1',
  1003.     'iso_8859_15': 'en_US.ISO8859-15',
  1004.     'it': 'it_IT.ISO8859-1',
  1005.     'it_ch': 'it_CH.ISO8859-1',
  1006.     'it_ch.iso88591': 'it_CH.ISO8859-1',
  1007.     'it_ch.iso885915': 'it_CH.ISO8859-15',
  1008.     'it_ch@euro': 'it_CH.ISO8859-15',
  1009.     'it_it': 'it_IT.ISO8859-1',
  1010.     'it_it.88591': 'it_IT.ISO8859-1',
  1011.     'it_it.iso88591': 'it_IT.ISO8859-1',
  1012.     'it_it.iso885915': 'it_IT.ISO8859-15',
  1013.     'it_it.iso885915@euro': 'it_IT.ISO8859-15',
  1014.     'it_it.utf8@euro': 'it_IT.UTF-8',
  1015.     'it_it@euro': 'it_IT.ISO8859-15',
  1016.     'italian': 'it_IT.ISO8859-1',
  1017.     'italian.iso88591': 'it_IT.ISO8859-1',
  1018.     'iu': 'iu_CA.NUNACOM-8',
  1019.     'iu_ca': 'iu_CA.NUNACOM-8',
  1020.     'iu_ca.nunacom8': 'iu_CA.NUNACOM-8',
  1021.     'iw': 'he_IL.ISO8859-8',
  1022.     'iw_il': 'he_IL.ISO8859-8',
  1023.     'iw_il.iso88598': 'he_IL.ISO8859-8',
  1024.     'ja': 'ja_JP.eucJP',
  1025.     'ja.jis': 'ja_JP.JIS7',
  1026.     'ja.sjis': 'ja_JP.SJIS',
  1027.     'ja_jp': 'ja_JP.eucJP',
  1028.     'ja_jp.ajec': 'ja_JP.eucJP',
  1029.     'ja_jp.euc': 'ja_JP.eucJP',
  1030.     'ja_jp.eucjp': 'ja_JP.eucJP',
  1031.     'ja_jp.iso-2022-jp': 'ja_JP.JIS7',
  1032.     'ja_jp.iso2022jp': 'ja_JP.JIS7',
  1033.     'ja_jp.jis': 'ja_JP.JIS7',
  1034.     'ja_jp.jis7': 'ja_JP.JIS7',
  1035.     'ja_jp.mscode': 'ja_JP.SJIS',
  1036.     'ja_jp.sjis': 'ja_JP.SJIS',
  1037.     'ja_jp.ujis': 'ja_JP.eucJP',
  1038.     'japan': 'ja_JP.eucJP',
  1039.     'japanese': 'ja_JP.eucJP',
  1040.     'japanese-euc': 'ja_JP.eucJP',
  1041.     'japanese.euc': 'ja_JP.eucJP',
  1042.     'japanese.sjis': 'ja_JP.SJIS',
  1043.     'jp_jp': 'ja_JP.eucJP',
  1044.     'ka': 'ka_GE.GEORGIAN-ACADEMY',
  1045.     'ka_ge': 'ka_GE.GEORGIAN-ACADEMY',
  1046.     'ka_ge.georgianacademy': 'ka_GE.GEORGIAN-ACADEMY',
  1047.     'ka_ge.georgianps': 'ka_GE.GEORGIAN-PS',
  1048.     'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY',
  1049.     'kl': 'kl_GL.ISO8859-1',
  1050.     'kl_gl': 'kl_GL.ISO8859-1',
  1051.     'kl_gl.iso88591': 'kl_GL.ISO8859-1',
  1052.     'kl_gl.iso885915': 'kl_GL.ISO8859-15',
  1053.     'kl_gl@euro': 'kl_GL.ISO8859-15',
  1054.     'km_kh': 'km_KH.UTF-8',
  1055.     'kn_in': 'kn_IN.UTF-8',
  1056.     'ko': 'ko_KR.eucKR',
  1057.     'ko_kr': 'ko_KR.eucKR',
  1058.     'ko_kr.euc': 'ko_KR.eucKR',
  1059.     'ko_kr.euckr': 'ko_KR.eucKR',
  1060.     'korean': 'ko_KR.eucKR',
  1061.     'korean.euc': 'ko_KR.eucKR',
  1062.     'kw': 'kw_GB.ISO8859-1',
  1063.     'kw_gb': 'kw_GB.ISO8859-1',
  1064.     'kw_gb.iso88591': 'kw_GB.ISO8859-1',
  1065.     'kw_gb.iso885914': 'kw_GB.ISO8859-14',
  1066.     'kw_gb.iso885915': 'kw_GB.ISO8859-15',
  1067.     'kw_gb@euro': 'kw_GB.ISO8859-15',
  1068.     'ky': 'ky_KG.UTF-8',
  1069.     'ky_kg': 'ky_KG.UTF-8',
  1070.     'lithuanian': 'lt_LT.ISO8859-13',
  1071.     'lo': 'lo_LA.MULELAO-1',
  1072.     'lo_la': 'lo_LA.MULELAO-1',
  1073.     'lo_la.cp1133': 'lo_LA.IBM-CP1133',
  1074.     'lo_la.ibmcp1133': 'lo_LA.IBM-CP1133',
  1075.     'lo_la.mulelao1': 'lo_LA.MULELAO-1',
  1076.     'lt': 'lt_LT.ISO8859-13',
  1077.     'lt_lt': 'lt_LT.ISO8859-13',
  1078.     'lt_lt.iso885913': 'lt_LT.ISO8859-13',
  1079.     'lt_lt.iso88594': 'lt_LT.ISO8859-4',
  1080.     'lv': 'lv_LV.ISO8859-13',
  1081.     'lv_lv': 'lv_LV.ISO8859-13',
  1082.     'lv_lv.iso885913': 'lv_LV.ISO8859-13',
  1083.     'lv_lv.iso88594': 'lv_LV.ISO8859-4',
  1084.     'mi': 'mi_NZ.ISO8859-1',
  1085.     'mi_nz': 'mi_NZ.ISO8859-1',
  1086.     'mi_nz.iso88591': 'mi_NZ.ISO8859-1',
  1087.     'mk': 'mk_MK.ISO8859-5',
  1088.     'mk_mk': 'mk_MK.ISO8859-5',
  1089.     'mk_mk.cp1251': 'mk_MK.CP1251',
  1090.     'mk_mk.iso88595': 'mk_MK.ISO8859-5',
  1091.     'mk_mk.microsoftcp1251': 'mk_MK.CP1251',
  1092.     'mr_in': 'mr_IN.UTF-8',
  1093.     'ms': 'ms_MY.ISO8859-1',
  1094.     'ms_my': 'ms_MY.ISO8859-1',
  1095.     'ms_my.iso88591': 'ms_MY.ISO8859-1',
  1096.     'mt': 'mt_MT.ISO8859-3',
  1097.     'mt_mt': 'mt_MT.ISO8859-3',
  1098.     'mt_mt.iso88593': 'mt_MT.ISO8859-3',
  1099.     'nb': 'nb_NO.ISO8859-1',
  1100.     'nb_no': 'nb_NO.ISO8859-1',
  1101.     'nb_no.88591': 'nb_NO.ISO8859-1',
  1102.     'nb_no.iso88591': 'nb_NO.ISO8859-1',
  1103.     'nb_no.iso885915': 'nb_NO.ISO8859-15',
  1104.     'nb_no@euro': 'nb_NO.ISO8859-15',
  1105.     'nl': 'nl_NL.ISO8859-1',
  1106.     'nl_be': 'nl_BE.ISO8859-1',
  1107.     'nl_be.88591': 'nl_BE.ISO8859-1',
  1108.     'nl_be.iso88591': 'nl_BE.ISO8859-1',
  1109.     'nl_be.iso885915': 'nl_BE.ISO8859-15',
  1110.     'nl_be.iso885915@euro': 'nl_BE.ISO8859-15',
  1111.     'nl_be.utf8@euro': 'nl_BE.UTF-8',
  1112.     'nl_be@euro': 'nl_BE.ISO8859-15',
  1113.     'nl_nl': 'nl_NL.ISO8859-1',
  1114.     'nl_nl.88591': 'nl_NL.ISO8859-1',
  1115.     'nl_nl.iso88591': 'nl_NL.ISO8859-1',
  1116.     'nl_nl.iso885915': 'nl_NL.ISO8859-15',
  1117.     'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15',
  1118.     'nl_nl.utf8@euro': 'nl_NL.UTF-8',
  1119.     'nl_nl@euro': 'nl_NL.ISO8859-15',
  1120.     'nn': 'nn_NO.ISO8859-1',
  1121.     'nn_no': 'nn_NO.ISO8859-1',
  1122.     'nn_no.88591': 'nn_NO.ISO8859-1',
  1123.     'nn_no.iso88591': 'nn_NO.ISO8859-1',
  1124.     'nn_no.iso885915': 'nn_NO.ISO8859-15',
  1125.     'nn_no@euro': 'nn_NO.ISO8859-15',
  1126.     'no': 'no_NO.ISO8859-1',
  1127.     'no@nynorsk': 'ny_NO.ISO8859-1',
  1128.     'no_no': 'no_NO.ISO8859-1',
  1129.     'no_no.88591': 'no_NO.ISO8859-1',
  1130.     'no_no.iso88591': 'no_NO.ISO8859-1',
  1131.     'no_no.iso885915': 'no_NO.ISO8859-15',
  1132.     'no_no@euro': 'no_NO.ISO8859-15',
  1133.     'norwegian': 'no_NO.ISO8859-1',
  1134.     'norwegian.iso88591': 'no_NO.ISO8859-1',
  1135.     'nr': 'nr_ZA.ISO8859-1',
  1136.     'nr_za': 'nr_ZA.ISO8859-1',
  1137.     'nr_za.iso88591': 'nr_ZA.ISO8859-1',
  1138.     'nso': 'nso_ZA.ISO8859-15',
  1139.     'nso_za': 'nso_ZA.ISO8859-15',
  1140.     'nso_za.iso885915': 'nso_ZA.ISO8859-15',
  1141.     'ny': 'ny_NO.ISO8859-1',
  1142.     'ny_no': 'ny_NO.ISO8859-1',
  1143.     'ny_no.88591': 'ny_NO.ISO8859-1',
  1144.     'ny_no.iso88591': 'ny_NO.ISO8859-1',
  1145.     'ny_no.iso885915': 'ny_NO.ISO8859-15',
  1146.     'ny_no@euro': 'ny_NO.ISO8859-15',
  1147.     'nynorsk': 'nn_NO.ISO8859-1',
  1148.     'oc': 'oc_FR.ISO8859-1',
  1149.     'oc_fr': 'oc_FR.ISO8859-1',
  1150.     'oc_fr.iso88591': 'oc_FR.ISO8859-1',
  1151.     'oc_fr.iso885915': 'oc_FR.ISO8859-15',
  1152.     'oc_fr@euro': 'oc_FR.ISO8859-15',
  1153.     'pa_in': 'pa_IN.UTF-8',
  1154.     'pd': 'pd_US.ISO8859-1',
  1155.     'pd_de': 'pd_DE.ISO8859-1',
  1156.     'pd_de.iso88591': 'pd_DE.ISO8859-1',
  1157.     'pd_de.iso885915': 'pd_DE.ISO8859-15',
  1158.     'pd_de@euro': 'pd_DE.ISO8859-15',
  1159.     'pd_us': 'pd_US.ISO8859-1',
  1160.     'pd_us.iso88591': 'pd_US.ISO8859-1',
  1161.     'pd_us.iso885915': 'pd_US.ISO8859-15',
  1162.     'pd_us@euro': 'pd_US.ISO8859-15',
  1163.     'ph': 'ph_PH.ISO8859-1',
  1164.     'ph_ph': 'ph_PH.ISO8859-1',
  1165.     'ph_ph.iso88591': 'ph_PH.ISO8859-1',
  1166.     'pl': 'pl_PL.ISO8859-2',
  1167.     'pl_pl': 'pl_PL.ISO8859-2',
  1168.     'pl_pl.iso88592': 'pl_PL.ISO8859-2',
  1169.     'polish': 'pl_PL.ISO8859-2',
  1170.     'portuguese': 'pt_PT.ISO8859-1',
  1171.     'portuguese.iso88591': 'pt_PT.ISO8859-1',
  1172.     'portuguese_brazil': 'pt_BR.ISO8859-1',
  1173.     'portuguese_brazil.8859': 'pt_BR.ISO8859-1',
  1174.     'posix': 'C',
  1175.     'posix-utf2': 'C',
  1176.     'pp': 'pp_AN.ISO8859-1',
  1177.     'pp_an': 'pp_AN.ISO8859-1',
  1178.     'pp_an.iso88591': 'pp_AN.ISO8859-1',
  1179.     'pt': 'pt_PT.ISO8859-1',
  1180.     'pt_br': 'pt_BR.ISO8859-1',
  1181.     'pt_br.88591': 'pt_BR.ISO8859-1',
  1182.     'pt_br.iso88591': 'pt_BR.ISO8859-1',
  1183.     'pt_br.iso885915': 'pt_BR.ISO8859-15',
  1184.     'pt_br@euro': 'pt_BR.ISO8859-15',
  1185.     'pt_pt': 'pt_PT.ISO8859-1',
  1186.     'pt_pt.88591': 'pt_PT.ISO8859-1',
  1187.     'pt_pt.iso88591': 'pt_PT.ISO8859-1',
  1188.     'pt_pt.iso885915': 'pt_PT.ISO8859-15',
  1189.     'pt_pt.iso885915@euro': 'pt_PT.ISO8859-15',
  1190.     'pt_pt.utf8@euro': 'pt_PT.UTF-8',
  1191.     'pt_pt@euro': 'pt_PT.ISO8859-15',
  1192.     'ro': 'ro_RO.ISO8859-2',
  1193.     'ro_ro': 'ro_RO.ISO8859-2',
  1194.     'ro_ro.iso88592': 'ro_RO.ISO8859-2',
  1195.     'romanian': 'ro_RO.ISO8859-2',
  1196.     'ru': 'ru_RU.ISO8859-5',
  1197.     'ru_ru': 'ru_RU.ISO8859-5',
  1198.     'ru_ru.cp1251': 'ru_RU.CP1251',
  1199.     'ru_ru.iso88595': 'ru_RU.ISO8859-5',
  1200.     'ru_ru.koi8r': 'ru_RU.KOI8-R',
  1201.     'ru_ru.microsoftcp1251': 'ru_RU.CP1251',
  1202.     'ru_ua': 'ru_UA.KOI8-U',
  1203.     'ru_ua.cp1251': 'ru_UA.CP1251',
  1204.     'ru_ua.koi8u': 'ru_UA.KOI8-U',
  1205.     'ru_ua.microsoftcp1251': 'ru_UA.CP1251',
  1206.     'rumanian': 'ro_RO.ISO8859-2',
  1207.     'russian': 'ru_RU.ISO8859-5',
  1208.     'rw': 'rw_RW.ISO8859-1',
  1209.     'rw_rw': 'rw_RW.ISO8859-1',
  1210.     'rw_rw.iso88591': 'rw_RW.ISO8859-1',
  1211.     'se_no': 'se_NO.UTF-8',
  1212.     'serbocroatian': 'sr_CS.ISO8859-2',
  1213.     'sh': 'sr_CS.ISO8859-2',
  1214.     'sh_hr': 'sh_HR.ISO8859-2',
  1215.     'sh_hr.iso88592': 'hr_HR.ISO8859-2',
  1216.     'sh_sp': 'sr_CS.ISO8859-2',
  1217.     'sh_yu': 'sr_CS.ISO8859-2',
  1218.     'si': 'si_LK.UTF-8',
  1219.     'si_lk': 'si_LK.UTF-8',
  1220.     'sinhala': 'si_LK.UTF-8',
  1221.     'sk': 'sk_SK.ISO8859-2',
  1222.     'sk_sk': 'sk_SK.ISO8859-2',
  1223.     'sk_sk.iso88592': 'sk_SK.ISO8859-2',
  1224.     'sl': 'sl_SI.ISO8859-2',
  1225.     'sl_cs': 'sl_CS.ISO8859-2',
  1226.     'sl_si': 'sl_SI.ISO8859-2',
  1227.     'sl_si.iso88592': 'sl_SI.ISO8859-2',
  1228.     'slovak': 'sk_SK.ISO8859-2',
  1229.     'slovene': 'sl_SI.ISO8859-2',
  1230.     'slovenian': 'sl_SI.ISO8859-2',
  1231.     'sp': 'sr_CS.ISO8859-5',
  1232.     'sp_yu': 'sr_CS.ISO8859-5',
  1233.     'spanish': 'es_ES.ISO8859-1',
  1234.     'spanish.iso88591': 'es_ES.ISO8859-1',
  1235.     'spanish_spain': 'es_ES.ISO8859-1',
  1236.     'spanish_spain.8859': 'es_ES.ISO8859-1',
  1237.     'sq': 'sq_AL.ISO8859-2',
  1238.     'sq_al': 'sq_AL.ISO8859-2',
  1239.     'sq_al.iso88592': 'sq_AL.ISO8859-2',
  1240.     'sr': 'sr_CS.ISO8859-5',
  1241.     'sr@cyrillic': 'sr_CS.ISO8859-5',
  1242.     'sr@latn': 'sr_CS.ISO8859-2',
  1243.     'sr_cs.iso88592': 'sr_CS.ISO8859-2',
  1244.     'sr_cs.iso88592@latn': 'sr_CS.ISO8859-2',
  1245.     'sr_cs.iso88595': 'sr_CS.ISO8859-5',
  1246.     'sr_cs.utf8@latn': 'sr_CS.UTF-8',
  1247.     'sr_cs@latn': 'sr_CS.ISO8859-2',
  1248.     'sr_sp': 'sr_CS.ISO8859-2',
  1249.     'sr_yu': 'sr_CS.ISO8859-5',
  1250.     'sr_yu.cp1251@cyrillic': 'sr_CS.CP1251',
  1251.     'sr_yu.iso88592': 'sr_CS.ISO8859-2',
  1252.     'sr_yu.iso88595': 'sr_CS.ISO8859-5',
  1253.     'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5',
  1254.     'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251',
  1255.     'sr_yu.utf8@cyrillic': 'sr_CS.UTF-8',
  1256.     'sr_yu@cyrillic': 'sr_CS.ISO8859-5',
  1257.     'ss': 'ss_ZA.ISO8859-1',
  1258.     'ss_za': 'ss_ZA.ISO8859-1',
  1259.     'ss_za.iso88591': 'ss_ZA.ISO8859-1',
  1260.     'st': 'st_ZA.ISO8859-1',
  1261.     'st_za': 'st_ZA.ISO8859-1',
  1262.     'st_za.iso88591': 'st_ZA.ISO8859-1',
  1263.     'sv': 'sv_SE.ISO8859-1',
  1264.     'sv_fi': 'sv_FI.ISO8859-1',
  1265.     'sv_fi.iso88591': 'sv_FI.ISO8859-1',
  1266.     'sv_fi.iso885915': 'sv_FI.ISO8859-15',
  1267.     'sv_fi.iso885915@euro': 'sv_FI.ISO8859-15',
  1268.     'sv_fi.utf8@euro': 'sv_FI.UTF-8',
  1269.     'sv_fi@euro': 'sv_FI.ISO8859-15',
  1270.     'sv_se': 'sv_SE.ISO8859-1',
  1271.     'sv_se.88591': 'sv_SE.ISO8859-1',
  1272.     'sv_se.iso88591': 'sv_SE.ISO8859-1',
  1273.     'sv_se.iso885915': 'sv_SE.ISO8859-15',
  1274.     'sv_se@euro': 'sv_SE.ISO8859-15',
  1275.     'swedish': 'sv_SE.ISO8859-1',
  1276.     'swedish.iso88591': 'sv_SE.ISO8859-1',
  1277.     'ta': 'ta_IN.TSCII-0',
  1278.     'ta_in': 'ta_IN.TSCII-0',
  1279.     'ta_in.tscii': 'ta_IN.TSCII-0',
  1280.     'ta_in.tscii0': 'ta_IN.TSCII-0',
  1281.     'tg': 'tg_TJ.KOI8-C',
  1282.     'tg_tj': 'tg_TJ.KOI8-C',
  1283.     'tg_tj.koi8c': 'tg_TJ.KOI8-C',
  1284.     'th': 'th_TH.ISO8859-11',
  1285.     'th_th': 'th_TH.ISO8859-11',
  1286.     'th_th.iso885911': 'th_TH.ISO8859-11',
  1287.     'th_th.tactis': 'th_TH.TIS620',
  1288.     'th_th.tis620': 'th_TH.TIS620',
  1289.     'thai': 'th_TH.ISO8859-11',
  1290.     'tl': 'tl_PH.ISO8859-1',
  1291.     'tl_ph': 'tl_PH.ISO8859-1',
  1292.     'tl_ph.iso88591': 'tl_PH.ISO8859-1',
  1293.     'tn': 'tn_ZA.ISO8859-15',
  1294.     'tn_za': 'tn_ZA.ISO8859-15',
  1295.     'tn_za.iso885915': 'tn_ZA.ISO8859-15',
  1296.     'tr': 'tr_TR.ISO8859-9',
  1297.     'tr_tr': 'tr_TR.ISO8859-9',
  1298.     'tr_tr.iso88599': 'tr_TR.ISO8859-9',
  1299.     'ts': 'ts_ZA.ISO8859-1',
  1300.     'ts_za': 'ts_ZA.ISO8859-1',
  1301.     'ts_za.iso88591': 'ts_ZA.ISO8859-1',
  1302.     'tt': 'tt_RU.TATAR-CYR',
  1303.     'tt_ru': 'tt_RU.TATAR-CYR',
  1304.     'tt_ru.koi8c': 'tt_RU.KOI8-C',
  1305.     'tt_ru.tatarcyr': 'tt_RU.TATAR-CYR',
  1306.     'turkish': 'tr_TR.ISO8859-9',
  1307.     'turkish.iso88599': 'tr_TR.ISO8859-9',
  1308.     'uk': 'uk_UA.KOI8-U',
  1309.     'uk_ua': 'uk_UA.KOI8-U',
  1310.     'uk_ua.cp1251': 'uk_UA.CP1251',
  1311.     'uk_ua.iso88595': 'uk_UA.ISO8859-5',
  1312.     'uk_ua.koi8u': 'uk_UA.KOI8-U',
  1313.     'uk_ua.microsoftcp1251': 'uk_UA.CP1251',
  1314.     'univ': 'en_US.UTF-8',
  1315.     'universal': 'en_US.UTF-8',
  1316.     'universal.utf8@ucs4': 'en_US.UTF-8',
  1317.     'ur': 'ur_PK.CP1256',
  1318.     'ur_pk': 'ur_PK.CP1256',
  1319.     'ur_pk.cp1256': 'ur_PK.CP1256',
  1320.     'ur_pk.microsoftcp1256': 'ur_PK.CP1256',
  1321.     'uz': 'uz_UZ.UTF-8',
  1322.     'uz_uz': 'uz_UZ.UTF-8',
  1323.     'uz_uz.iso88591': 'uz_UZ.ISO8859-1',
  1324.     'uz_uz.utf8@cyrillic': 'uz_UZ.UTF-8',
  1325.     'uz_uz@cyrillic': 'uz_UZ.UTF-8',
  1326.     've': 've_ZA.UTF-8',
  1327.     've_za': 've_ZA.UTF-8',
  1328.     'vi': 'vi_VN.TCVN',
  1329.     'vi_vn': 'vi_VN.TCVN',
  1330.     'vi_vn.tcvn': 'vi_VN.TCVN',
  1331.     'vi_vn.tcvn5712': 'vi_VN.TCVN',
  1332.     'vi_vn.viscii': 'vi_VN.VISCII',
  1333.     'vi_vn.viscii111': 'vi_VN.VISCII',
  1334.     'wa': 'wa_BE.ISO8859-1',
  1335.     'wa_be': 'wa_BE.ISO8859-1',
  1336.     'wa_be.iso88591': 'wa_BE.ISO8859-1',
  1337.     'wa_be.iso885915': 'wa_BE.ISO8859-15',
  1338.     'wa_be.iso885915@euro': 'wa_BE.ISO8859-15',
  1339.     'wa_be@euro': 'wa_BE.ISO8859-15',
  1340.     'xh': 'xh_ZA.ISO8859-1',
  1341.     'xh_za': 'xh_ZA.ISO8859-1',
  1342.     'xh_za.iso88591': 'xh_ZA.ISO8859-1',
  1343.     'yi': 'yi_US.CP1255',
  1344.     'yi_us': 'yi_US.CP1255',
  1345.     'yi_us.cp1255': 'yi_US.CP1255',
  1346.     'yi_us.microsoftcp1255': 'yi_US.CP1255',
  1347.     'zh': 'zh_CN.eucCN',
  1348.     'zh_cn': 'zh_CN.gb2312',
  1349.     'zh_cn.big5': 'zh_TW.big5',
  1350.     'zh_cn.euc': 'zh_CN.eucCN',
  1351.     'zh_cn.gb18030': 'zh_CN.gb18030',
  1352.     'zh_cn.gb2312': 'zh_CN.gb2312',
  1353.     'zh_cn.gbk': 'zh_CN.gbk',
  1354.     'zh_hk': 'zh_HK.big5hkscs',
  1355.     'zh_hk.big5': 'zh_HK.big5',
  1356.     'zh_hk.big5hkscs': 'zh_HK.big5hkscs',
  1357.     'zh_tw': 'zh_TW.big5',
  1358.     'zh_tw.big5': 'zh_TW.big5',
  1359.     'zh_tw.euc': 'zh_TW.eucTW',
  1360.     'zh_tw.euctw': 'zh_TW.eucTW',
  1361.     'zu': 'zu_ZA.ISO8859-1',
  1362.     'zu_za': 'zu_ZA.ISO8859-1',
  1363.     'zu_za.iso88591': 'zu_ZA.ISO8859-1' }
  1364. windows_locale = {
  1365.     1078: 'af_ZA',
  1366.     1052: 'sq_AL',
  1367.     1025: 'ar_SA',
  1368.     2049: 'ar_IQ',
  1369.     3073: 'ar_EG',
  1370.     4097: 'ar_LY',
  1371.     5121: 'ar_DZ',
  1372.     6145: 'ar_MA',
  1373.     7169: 'ar_TN',
  1374.     8193: 'ar_OM',
  1375.     9217: 'ar_YE',
  1376.     10241: 'ar_SY',
  1377.     11265: 'ar_JO',
  1378.     12289: 'ar_LB',
  1379.     13313: 'ar_KW',
  1380.     14337: 'ar_AE',
  1381.     15361: 'ar_BH',
  1382.     16385: 'ar_QA',
  1383.     1067: 'hy_AM',
  1384.     1068: 'az_AZ',
  1385.     2092: 'az_AZ',
  1386.     1069: 'eu_ES',
  1387.     1059: 'be_BY',
  1388.     1093: 'bn_IN',
  1389.     8218: 'bs_BA',
  1390.     5146: 'bs_BA',
  1391.     1150: 'br_FR',
  1392.     1026: 'bg_BG',
  1393.     1027: 'ca_ES',
  1394.     4: 'zh_CHS',
  1395.     1028: 'zh_TW',
  1396.     2052: 'zh_CN',
  1397.     3076: 'zh_HK',
  1398.     4100: 'zh_SG',
  1399.     5124: 'zh_MO',
  1400.     31748: 'zh_CHT',
  1401.     1050: 'hr_HR',
  1402.     4122: 'hr_BA',
  1403.     1029: 'cs_CZ',
  1404.     1030: 'da_DK',
  1405.     1164: 'gbz_AF',
  1406.     1125: 'div_MV',
  1407.     1043: 'nl_NL',
  1408.     2067: 'nl_BE',
  1409.     1033: 'en_US',
  1410.     2057: 'en_GB',
  1411.     3081: 'en_AU',
  1412.     4105: 'en_CA',
  1413.     5129: 'en_NZ',
  1414.     6153: 'en_IE',
  1415.     7177: 'en_ZA',
  1416.     8201: 'en_JA',
  1417.     9225: 'en_CB',
  1418.     10249: 'en_BZ',
  1419.     11273: 'en_TT',
  1420.     12297: 'en_ZW',
  1421.     13321: 'en_PH',
  1422.     1061: 'et_EE',
  1423.     1080: 'fo_FO',
  1424.     1124: 'fil_PH',
  1425.     1035: 'fi_FI',
  1426.     1036: 'fr_FR',
  1427.     2060: 'fr_BE',
  1428.     3084: 'fr_CA',
  1429.     4108: 'fr_CH',
  1430.     5132: 'fr_LU',
  1431.     6156: 'fr_MC',
  1432.     1122: 'fy_NL',
  1433.     1110: 'gl_ES',
  1434.     1079: 'ka_GE',
  1435.     1031: 'de_DE',
  1436.     2055: 'de_CH',
  1437.     3079: 'de_AT',
  1438.     4103: 'de_LU',
  1439.     5127: 'de_LI',
  1440.     1032: 'el_GR',
  1441.     1095: 'gu_IN',
  1442.     1037: 'he_IL',
  1443.     1081: 'hi_IN',
  1444.     1038: 'hu_HU',
  1445.     1039: 'is_IS',
  1446.     1057: 'id_ID',
  1447.     1117: 'iu_CA',
  1448.     2141: 'iu_CA',
  1449.     2108: 'ga_IE',
  1450.     1076: 'xh_ZA',
  1451.     1077: 'zu_ZA',
  1452.     1040: 'it_IT',
  1453.     2064: 'it_CH',
  1454.     1041: 'ja_JP',
  1455.     1099: 'kn_IN',
  1456.     1087: 'kk_KZ',
  1457.     1111: 'kok_IN',
  1458.     1042: 'ko_KR',
  1459.     1088: 'ky_KG',
  1460.     1062: 'lv_LV',
  1461.     1063: 'lt_LT',
  1462.     1134: 'lb_LU',
  1463.     1071: 'mk_MK',
  1464.     1086: 'ms_MY',
  1465.     2110: 'ms_BN',
  1466.     1100: 'ml_IN',
  1467.     1082: 'mt_MT',
  1468.     1153: 'mi_NZ',
  1469.     1146: 'arn_CL',
  1470.     1102: 'mr_IN',
  1471.     1148: 'moh_CA',
  1472.     1104: 'mn_MN',
  1473.     1121: 'ne_NP',
  1474.     1044: 'nb_NO',
  1475.     2068: 'nn_NO',
  1476.     1154: 'oc_FR',
  1477.     1096: 'or_IN',
  1478.     1123: 'ps_AF',
  1479.     1065: 'fa_IR',
  1480.     1045: 'pl_PL',
  1481.     1046: 'pt_BR',
  1482.     2070: 'pt_PT',
  1483.     1094: 'pa_IN',
  1484.     1131: 'quz_BO',
  1485.     2155: 'quz_EC',
  1486.     3179: 'quz_PE',
  1487.     1048: 'ro_RO',
  1488.     1047: 'rm_CH',
  1489.     1049: 'ru_RU',
  1490.     9275: 'smn_FI',
  1491.     4155: 'smj_NO',
  1492.     5179: 'smj_SE',
  1493.     1083: 'se_NO',
  1494.     2107: 'se_SE',
  1495.     3131: 'se_FI',
  1496.     8251: 'sms_FI',
  1497.     6203: 'sma_NO',
  1498.     7227: 'sma_SE',
  1499.     1103: 'sa_IN',
  1500.     3098: 'sr_SP',
  1501.     7194: 'sr_BA',
  1502.     2074: 'sr_SP',
  1503.     6170: 'sr_BA',
  1504.     1132: 'ns_ZA',
  1505.     1074: 'tn_ZA',
  1506.     1051: 'sk_SK',
  1507.     1060: 'sl_SI',
  1508.     1034: 'es_ES',
  1509.     2058: 'es_MX',
  1510.     3082: 'es_ES',
  1511.     4106: 'es_GT',
  1512.     5130: 'es_CR',
  1513.     6154: 'es_PA',
  1514.     7178: 'es_DO',
  1515.     8202: 'es_VE',
  1516.     9226: 'es_CO',
  1517.     10250: 'es_PE',
  1518.     11274: 'es_AR',
  1519.     12298: 'es_EC',
  1520.     13322: 'es_CL',
  1521.     14346: 'es_UR',
  1522.     15370: 'es_PY',
  1523.     16394: 'es_BO',
  1524.     17418: 'es_SV',
  1525.     18442: 'es_HN',
  1526.     19466: 'es_NI',
  1527.     20490: 'es_PR',
  1528.     1089: 'sw_KE',
  1529.     1053: 'sv_SE',
  1530.     2077: 'sv_FI',
  1531.     1114: 'syr_SY',
  1532.     1097: 'ta_IN',
  1533.     1092: 'tt_RU',
  1534.     1098: 'te_IN',
  1535.     1054: 'th_TH',
  1536.     1055: 'tr_TR',
  1537.     1058: 'uk_UA',
  1538.     1056: 'ur_PK',
  1539.     2080: 'ur_IN',
  1540.     1091: 'uz_UZ',
  1541.     2115: 'uz_UZ',
  1542.     1066: 'vi_VN',
  1543.     1106: 'cy_GB' }
  1544.  
  1545. def _print_locale():
  1546.     ''' Test function.
  1547.     '''
  1548.     categories = { }
  1549.     
  1550.     def _init_categories(categories = categories):
  1551.         for k, v in globals().items():
  1552.             if k[:3] == 'LC_':
  1553.                 categories[k] = v
  1554.                 continue
  1555.         
  1556.  
  1557.     _init_categories()
  1558.     del categories['LC_ALL']
  1559.     print 'Locale defaults as determined by getdefaultlocale():'
  1560.     print '-' * 72
  1561.     (lang, enc) = getdefaultlocale()
  1562.     print 'Language: ',
  1563.     if not lang:
  1564.         pass
  1565.     print '(undefined)'
  1566.     print 'Encoding: ',
  1567.     if not enc:
  1568.         pass
  1569.     print '(undefined)'
  1570.     print 
  1571.     print 'Locale settings on startup:'
  1572.     print '-' * 72
  1573.     for name, category in categories.items():
  1574.         print name, '...'
  1575.         (lang, enc) = getlocale(category)
  1576.         print '   Language: ',
  1577.         if not lang:
  1578.             pass
  1579.         print '(undefined)'
  1580.         print '   Encoding: ',
  1581.         if not enc:
  1582.             pass
  1583.         print '(undefined)'
  1584.         print 
  1585.     
  1586.     print 
  1587.     print 'Locale settings after calling resetlocale():'
  1588.     print '-' * 72
  1589.     resetlocale()
  1590.     for name, category in categories.items():
  1591.         print name, '...'
  1592.         (lang, enc) = getlocale(category)
  1593.         print '   Language: ',
  1594.         if not lang:
  1595.             pass
  1596.         print '(undefined)'
  1597.         print '   Encoding: ',
  1598.         if not enc:
  1599.             pass
  1600.         print '(undefined)'
  1601.         print 
  1602.     
  1603.     
  1604.     try:
  1605.         setlocale(LC_ALL, '')
  1606.     except:
  1607.         print 'NOTE:'
  1608.         print 'setlocale(LC_ALL, "") does not support the default locale'
  1609.         print 'given in the OS environment variables.'
  1610.  
  1611.     print 
  1612.     print 'Locale settings after calling setlocale(LC_ALL, ""):'
  1613.     print '-' * 72
  1614.     for name, category in categories.items():
  1615.         print name, '...'
  1616.         (lang, enc) = getlocale(category)
  1617.         print '   Language: ',
  1618.         if not lang:
  1619.             pass
  1620.         print '(undefined)'
  1621.         print '   Encoding: ',
  1622.         if not enc:
  1623.             pass
  1624.         print '(undefined)'
  1625.         print 
  1626.     
  1627.  
  1628.  
  1629. try:
  1630.     LC_MESSAGES
  1631. except NameError:
  1632.     pass
  1633.  
  1634. __all__.append('LC_MESSAGES')
  1635. if __name__ == '__main__':
  1636.     print 'Locale aliasing:'
  1637.     print 
  1638.     _print_locale()
  1639.     print 
  1640.     print 'Number formatting:'
  1641.     print 
  1642.     _test()
  1643.  
  1644.